// pages/helps/helps.js
var that,
  api = new(require('../../utils/api.js')),
  headimg = api.getimgurl(),
  WxParse = require('../../wxParse/wxParse.js'),
  app = getApp(),
  util = new(require('../../utils/util.js'));
Page({

  /**
   * 页面的初始数据
   */
  data: {
    
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
   that=this
    api.getsetting( res => {
      if (res.data.issuccess == 1) {
        var article=that.replaceraw(decodeURIComponent(res.data.data.Borrowing_rule));
        WxParse.wxParse('article', 'html', article, that, 5);
        console.log(article)
      }
    });
  },
  toCollect:function(e){
    console.log(e);
    var page = "/pages/helps/"+e.currentTarget.dataset.url;
    wx.navigateTo({
      url: page,
    })
  },
   replaceraw(content) {
       return content.replace('rgb(', 'rgb').replace(new RegExp('rgb', 'g'), "rgb(");
   },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})